<template>
  <el-table :data="data" border @row-click="onSelectData">
    <el-table-column :label="item.label" :prop="item.prop" :width="item.width" v-for="(item, index) in columns" :key="index" align="center">
      <template slot-scope="scope">
        {{ scope.row[item.prop] }}
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  name: 'searchTable',
  props: ['data', 'columns'],
  data(){
    return {}
  },
  methods:{
    onSelectData(e){
      this.$emit('searchData', e)
    }
  }
}
</script>
